#!/bin/bash

NAME=rocketmq-broker
PORT=10911
TAG=4.9.4

while getopts "n:p:t:" opt; do
  case $opt in
    n)
        NAME=$OPTARG
        ;;
    p)
        PORT=$OPTARG
        ;;
    t)
        TAG=$OPTARG
        ;;
    \?)
        echo "invalid arg"
        exit 1
        ;;
  esac
done

docker run \
-d \
--restart always \
--name ${NAME} \
--network host \
-v /home/rocketmq-server/conf:/home/rocketmq/rocketmq-${TAG}/conf \
-v /home/rocketmq-server/store:/tmp/store \
apache/rocketmq:${TAG} ./mqbroker -c ../conf/broker.conf